// store 仓库
//导入 createStore 函数  旧版 redux 的使用
import {createStore, applyMiddleware, combineReducers} from 'redux';
//导入 redux 开发者工具
import {composeWithDevTools} from 'redux-devtools-extension'
//thunk 转换程序
import thunk from 'redux-thunk';
//导入 reducer 函数
import CountReducer from './reducers/CountReducer';
import ZanReducer from './reducers/ZanReducer';
import TodosReducer from './reducers/TodosReducer';
//合并 reducer , redux 中的状态值就会变为一个『对象』
let rootReducer = combineReducers({
  count: CountReducer,
  zan: ZanReducer,
  todos: TodosReducer
});

//创建 store 对象
let store = createStore(rootReducer, composeWithDevTools(applyMiddleware(thunk)));

//暴露
export default store;

// store.dispatch((dispatch) => {
//   setTimeout(() => {
//     dispatch({type: 'add', payload: 100})
//   }, 1000)
// })





